#include<iostream>
#include<map>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

class Greater
{
public:
	bool operator()(const pair<string,int>& a,const pair<string, int>& b)
	{
		return (a.second > b.second) || ((a.second == b.second) && (a.first < b.first));
	}
};

//int main()
//{
//	string word[] = { "the", "day", "is", "sunny", "the", "the", "the", "sunny", "is", "is" };
//	map<string, int> countMap;
//	for (auto e : word)
//	{
//		countMap[e]++;
//	}
//
//	vector<pair<string, int>> sortV(countMap.begin(), countMap.end());
//
//	sort(sortV.begin(), sortV.end(), Greater());
//	vector<string> ret;
//	for (auto a : sortV)
//	{
//		ret.push_back(a.first);
//	}
//
//	for (auto& kv : ret)
//	{
//		cout << kv << " ";
//	}
//	cout << endl;
//	return 0;
//}

int main()
{
    string sentence;
    getline(cin, sentence);
    vector<string> words;
    int i = 0;
    while (i < sentence.size())
    {
        string s;
        while (sentence[i] != ' ' && sentence[i] != '.')
        {
            s += tolower(sentence[i]);
            i++;
        }
        words.push_back(s);
        i++;
    }

    map<string, int> countMap;
    for (auto e : words)
    {
        countMap[e]++;
    }
    vector<pair<string, int>> sortV(countMap.begin(), countMap.end());
    sort(sortV.begin(), sortV.end(), Greater());

    for (auto kv : sortV)
    {
        cout << kv.first << ":" << kv.second << endl;
    }
    return 0;
}